import request from "@/utils/request";

//课程分类类型
export interface courseCategoryType {
  choises: any[];
  formType: string;
  label: string;
  name: string;
  style: string;
  valueType: string;
}

//请求课程分类数据
export const requestCourseCategory = (path: string) => {
  return request.get<any, courseCategoryType[]>("/moment/properties/filter/" + path);
};

export interface contentType {
  activityTotalDays: number;
  aiyigeApplication: string;
  algorithmSortValue: number;
  avocationTags: any;
  channel: string;
  commodityBackup: { unitPrice: string, price: string, originPrice: string, showLinePrice: boolean };
  cover: string[];
  createTime: number;
  creator: string;
  creatorBackup: any;
  difficultDegreeValue: number;
  enclosureCount: number;
  favorableValue: number;
  id: string;
  initExposureNum: number;
  inventoryBackup: any;
  maxP: number;
  mediaSummary: { duration: number, count: number };
  momentClassificationBackup: { workTitle: string };
  momentId: string;
  moreBackup: any;
  needPromotion: number;
  notVipPromotion: number;
  num: number;
  onsellTime: number;
  onsellUpdateTime: number;
  otherTags: any[];
  popTrainingIndex: number;
  receiptsAmountCapacity: number;
  recentFavorableValue: number;
  router: string;
  statisticsBackup: any;
  status: string;
  subject: string;
  tags: any[];
  title: string;
  updateTime: number;
  version: number;
  vipPromotion: number;
  vipTag: { groupType: string };
}

export interface ResVideoContentType {
  content: contentType[];
  first: boolean;
  last: boolean;
  number: number;
  numberOfElements: number;
  offset: null;
  size: null;
  sort: null;
  statistics: null;
  totalElements: number;
  totalPages: number;
  useOffset: boolean;
}

//请求视频内容数据
export const requestVideoContent = (path: string, pageSize: number, pageNum: number) => {
  return request.post<any, ResVideoContentType>(`/moment/moments/collect/${path}/integrated`, {}, {
    params: {
      pageSize,
      pageNum
    }
  });
};
//请求视频内容-销量排序数据
export const requestVideoContentSalesOrder = (path: string, pageSize: number, pageNum: number) => {
  return request.post<any, ResVideoContentType>(`/moment/moments/collect/${path}/sellCountDesc`, {}, {
    params: {
      pageSize,
      pageNum
    }
  });
};